package test6;

public class Test {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                int sum = 0;
                for (int i = 1; i <= 500; i++) {
                    sum += i;
                }
                System.out.println(Thread.currentThread().getName() + "线程中计算1--500所有数字的累加和" + sum);
            }
        }).start();
    }
}
